/**
 * ...
 * @author Franco Ponticelli
 */

package uform.ui.comp;

import uform.property.Property;
import uform.property.IProperty;
import uform.ui.comp.Control;
import uform.ui.comp.Component;

class Label extends TextOutput
{
	public var linkedControl(default, null) : IProperty<Control<Dynamic>>;
	public function new(?text : String, ?linkedControl : Control<Dynamic>)
	{
		super(text);
		this.linkedControl = new Property();
		if (null != linkedControl)
			this.linkedControl.set(linkedControl);
	}
	
	override function _id() : String
	{
		return "L";
	}

	override function dispose()
	{
		linkedControl.onChange.clear();
		linkedControl = null;
		super.dispose();
	}
}